package com.superteam.zzl.view;


import android.app.Activity;

import android.os.Bundle;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.widget.Toast;


/**
 * Created by zhang on 2017/1/6.
 */

/**
 * Fragment 基类
 *  初始化布局
 *  初始化数据
 */

public abstract class BaseFragment extends Fragment{

    public Activity mActivity;
    protected boolean isVisible;
    public boolean isPrepared = false;

    //Fragment被创建
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mActivity = getActivity();//获取所挂载的Activity
    }

    /**
     * Activity创建结束，初始化数据
     * @param savedInstanceState
     */
    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

    }

    /**
     * [简化Toast]
     * @param msg
     */
    public void showToast(String msg){
        Toast.makeText(getActivity(),msg,Toast.LENGTH_SHORT).show();
    }

}
